package com.djq.hhc.config;

import com.djq.hhc.listener.RedisKeyOrderExpirationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: dadd7
 * @Date: 2023/04/06/下午 11:14
 * @Description:
 */

@Configuration
public class RedisConfig {

  // 需要装配该对象
  @Bean
  public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory factory) {
    RedisMessageListenerContainer container = new RedisMessageListenerContainer();
    container.setConnectionFactory(factory);
    return container;
  }

}